module fullAdder(input A,B,Cin, output S,Cout);
assign S = Xor(Xor(A,B),Cin);
assign Cout = Or(And(A,B),And(Cin,Xor(A,B));
endmodule
module And(input A,B, output C);
assign C = A & B;
endmodule
module Xor(input A,B, output C);
assign C = Or(And(A,~B), And(~A,B));
endmodule
module Or(input A,B, output C);
assign C = A | B;
endmodule